package com.isoft.airportsystem.mapper;


import com.isoft.airportsystem.entity.BLLS.DFLT_BLLS;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface BLLSMapper {
    /**
     * 添加行李提取信息（带行李带信息）
     * @param blls 行李提取信息对象
     * @param metaid 元数据ID
     * @return 影响行数
     */
    @Insert({
            "<script>",
            "INSERT INTO MSG_DFME_BLLS (",
            "DFLT_FLID, DFLT_FFID, DFLT_FIDE, DFLT_FATT,",
            "DFLT_BLBE_BTNO, DFLT_BLBE_ID, DFLT_BLBE_CODE, DFLT_BLBE_BTAT,",
            "DFLT_BLBE_ESTR, DFLT_BLBE_EEND, DFLT_BLBE_RSTR, DFLT_BLBE_REND, DFLT_BLBE_BTSC,",
            "META_ID",
            ") VALUES ",
            "<foreach collection='blls.belt' item='belt' separator=','>",
            "(",
            "#{blls.flid}, #{blls.ffid}, #{blls.fide}, #{blls.fatt},",
            "#{belt.btno}, #{belt.id}, #{belt.code}, #{belt.btat},",
            "#{belt.estr}, #{belt.eend}, #{belt.rstr}, #{belt.rend}, #{belt.btsc},",
            "#{metaid}",
            ")",
            "</foreach>",
            "</script>"
    })
    Integer add(@Param("blls") DFLT_BLLS blls, @Param("metaid") String metaid);

    /**
     * 添加行李提取信息（不带行李带信息）
     * @param blls 行李提取信息对象
     * @param metaid 元数据ID
     * @return 影响行数
     */
    @Insert("INSERT INTO MSG_DFME_BLLS (DFLT_FLID, DFLT_FFID, DFLT_FIDE, DFLT_FATT, META_ID) VALUES (#{blls.flid}, #{blls.ffid}, #{blls.fide}, #{blls.fatt}, #{metaid})")
    Integer addEmpy(@Param("blls") DFLT_BLLS blls, @Param("metaid") String metaid);
}